package io.renren.modules.generator.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.TTrainingObjectDao;
import io.renren.modules.generator.entity.TTrainingObjectEntity;
import io.renren.modules.generator.service.TTrainingObjectService;


@Service("tTrainingObjectService")
public class TTrainingObjectServiceImpl extends ServiceImpl<TTrainingObjectDao, TTrainingObjectEntity> implements TTrainingObjectService {

    @Autowired
    private TTrainingObjectDao trainingObjectDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<TTrainingObjectEntity> page = this.page(
                new Query<TTrainingObjectEntity>().getPage(params),
                new QueryWrapper<TTrainingObjectEntity>()
        );

        return new PageUtils(page);
    }

    /**
     * 根据科目名称和训练id  拿科目id
     */
    @Override
    public TTrainingObjectEntity getKmid(TTrainingObjectEntity trainingObjectEntity){
        return trainingObjectDao.getKmid(trainingObjectEntity);
    }

}